React Color Hue
Hue Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-color-hue
Usage
import Hue from '@uiw/react-color-hue';
function Demo() {
const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });
return (
<Hue
hue={hsva.h}
onChange={(newHue) => {
setHsva({ ...hsva, ...newHue });
}}
/>
);
}
Props
import { AlphaProps } from '@uiw/react-color-alpha';
interface HueProps extends Omit<AlphaProps, 'hsva' | 'onChange'> {
onChange?: (newHue: { h: number }) => void;
hue: number;
}
License
Licensed under the MIT License.